package com.ruoyi.car.domain;

import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 购车订单（订单页、订单详情）对象 t_purchase_order
 * 
 * @author yby
 * @date 2025-09-01
 */
public class PurchaseOrder extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 订单ID */
    private Long id;

    /** 订单编号（ORDER+yyyyMMddHHmmss+6位随机数） */
    @Excel(name = "订单编号", readConverterExp = "O=RDER+yyyyMMddHHmmss+6位随机数")
    private String orderNo;

    /** 买家ID（t_user.id） */
    @Excel(name = "买家ID", readConverterExp = "t=_user.id")
    private Long buyerId;

    /** 卖家ID（t_user.id） */
    @Excel(name = "卖家ID", readConverterExp = "t=_user.id")
    private Long sellerId;

    /** 关联车辆ID（t_car_info.id） */
    @Excel(name = "关联车辆ID", readConverterExp = "t=_car_info.id")
    private Long carId;

    /** 定金金额（元，如10000.00） */
    @Excel(name = "定金金额", readConverterExp = "元=，如10000.00")
    private BigDecimal depositAmount;

    /** 订单总金额（元） */
    @Excel(name = "订单总金额", readConverterExp = "元=")
    private BigDecimal totalAmount;

    /** 订单状态：1-待付定金，2-待付全款，3-待交付，4-已完成，5-已取消 */
    @Excel(name = "订单状态：1-待付定金，2-待付全款，3-待交付，4-已完成，5-已取消")
    private Long orderStatus;

    /** 支付时间（定金/全款统一记录） */
    @Excel(name = "支付时间", readConverterExp = "定=金/全款统一记录")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date payTime;

    /** 取消原因 */
    @Excel(name = "取消原因")
    private String cancelReason;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }

    public void setOrderNo(String orderNo) 
    {
        this.orderNo = orderNo;
    }

    public String getOrderNo() 
    {
        return orderNo;
    }

    public void setBuyerId(Long buyerId) 
    {
        this.buyerId = buyerId;
    }

    public Long getBuyerId() 
    {
        return buyerId;
    }

    public void setSellerId(Long sellerId) 
    {
        this.sellerId = sellerId;
    }

    public Long getSellerId() 
    {
        return sellerId;
    }

    public void setCarId(Long carId) 
    {
        this.carId = carId;
    }

    public Long getCarId() 
    {
        return carId;
    }

    public void setDepositAmount(BigDecimal depositAmount) 
    {
        this.depositAmount = depositAmount;
    }

    public BigDecimal getDepositAmount() 
    {
        return depositAmount;
    }

    public void setTotalAmount(BigDecimal totalAmount) 
    {
        this.totalAmount = totalAmount;
    }

    public BigDecimal getTotalAmount() 
    {
        return totalAmount;
    }

    public void setOrderStatus(Long orderStatus) 
    {
        this.orderStatus = orderStatus;
    }

    public Long getOrderStatus() 
    {
        return orderStatus;
    }

    public void setPayTime(Date payTime) 
    {
        this.payTime = payTime;
    }

    public Date getPayTime() 
    {
        return payTime;
    }

    public void setCancelReason(String cancelReason) 
    {
        this.cancelReason = cancelReason;
    }

    public String getCancelReason() 
    {
        return cancelReason;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("orderNo", getOrderNo())
            .append("buyerId", getBuyerId())
            .append("sellerId", getSellerId())
            .append("carId", getCarId())
            .append("depositAmount", getDepositAmount())
            .append("totalAmount", getTotalAmount())
            .append("orderStatus", getOrderStatus())
            .append("payTime", getPayTime())
            .append("cancelReason", getCancelReason())
            .append("createTime", getCreateTime())
            .toString();
    }
}
